package com.edu.mapper;

import com.edu.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentMapper {

    @Select("select * from student where stuId = #{stuId}")
    Student selectStudentById(int stuId);

    @Select("select * from student")
    List<Student> selectAllStudent();

    @Delete("delete from student where stuId = #{stuId}")
    int deleteStudent(int stuId);

    @Insert("insert into student(stuName,stuAge,stuSex) VALUES (#{stuName},#{stuAge},#{stuSex})")
    int insertStudent(Student student);

    @Update("update student set stuName = #{stuName},stuAge = #{stuAge},stuSex = #{stuSex} WHERE stuId = #{stuId}")
    int updateStudent(Student student);

}
